<html>
<head><meta charset="utf-8"><title>building crate with features · t-compiler/rust-analyzer · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/index.html">t-compiler/rust-analyzer</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/building.20crate.20with.20features.html">building crate with features</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="197764351"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/building%20crate%20with%20features/near/197764351" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Sunjay Varma <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/building.20crate.20with.20features.html#197764351">(May 15 2020 at 23:42)</a>:</h4>
<p>Is this the right place to ask questions about using rust-analyzer?</p>



<a name="197764353"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/building%20crate%20with%20features/near/197764353" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Sunjay Varma <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/building.20crate.20with.20features.html#197764353">(May 15 2020 at 23:42)</a>:</h4>
<p>I'm wondering if there is a <strong>cross-editor</strong> way to tell rust-analyzer to use a certain feature when it is building my crate</p>



<a name="197764430"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/building%20crate%20with%20features/near/197764430" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Sunjay Varma <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/building.20crate.20with.20features.html#197764430">(May 15 2020 at 23:44)</a>:</h4>
<p>Maybe there is a config file or something where I can tell rust-analyzer to use <code>--features "unstable"</code> when building my crate?</p>



<a name="197764449"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/building%20crate%20with%20features/near/197764449" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Sunjay Varma <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/building.20crate.20with.20features.html#197764449">(May 15 2020 at 23:45)</a>:</h4>
<p>I also have a "test" feature and it would be great if I could tell rust-analyzer to run test builds using that</p>



<a name="197764556"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/building%20crate%20with%20features/near/197764556" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Sunjay Varma <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/building.20crate.20with.20features.html#197764556">(May 15 2020 at 23:47)</a>:</h4>
<p>The features terminology can be a bit confusing, so to be clear I'm referring to "features" defined under the "[features]" table in my Cargo.toml file</p>



<a name="197764712"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/building%20crate%20with%20features/near/197764712" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/building.20crate.20with.20features.html#197764712">(May 15 2020 at 23:50)</a>:</h4>
<blockquote>
<p>Is this the right place to ask questions about using rust-analyzer?</p>
</blockquote>
<p>So far, yes. Though, I've been planing to create a category on urlo for some time now.</p>



<a name="197764737"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/building%20crate%20with%20features/near/197764737" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/building.20crate.20with.20features.html#197764737">(May 15 2020 at 23:51)</a>:</h4>
<p>The answer to your question is no -- unfortunatelly, LSP doesn't specify a cross-editor way  to store config, and I think it ideally should be handled on that layer</p>



<a name="197764796"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/building%20crate%20with%20features/near/197764796" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/building.20crate.20with.20features.html#197764796">(May 15 2020 at 23:52)</a>:</h4>
<p>I guess, in practice we also might add something like <code>rust-analyzer.toml</code>, but it does not feel like the <em>right</em> soln</p>



<a name="197779968"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/building%20crate%20with%20features/near/197779968" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pksunkara <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/building.20crate.20with.20features.html#197779968">(May 16 2020 at 06:23)</a>:</h4>
<p>What about <code>[package.metadata.rust-analyzer]</code> in <code>Cargo.toml</code>?</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>